// utils/timeUtils.ts
export function getFormattedTime(): string {
    const now = new Date(); // 获取当前时间
  
    const year = now.getFullYear(); // 年份
    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份，补零
    const date = String(now.getDate()).padStart(2, '0'); // 日期，补零
    const hours = String(now.getHours()).padStart(2, '0'); // 小时，补零
    const minutes = String(now.getMinutes()).padStart(2, '0'); // 分钟，补零
    const seconds = String(now.getSeconds()).padStart(2, '0'); // 秒，补零
  
    // 返回格式化字符串
    return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
  }
  